package cn.com.wangluotongxin.mall.controller.dubbo;

import cn.com.wangluotongxin.admin.DAdminAppVersionService;
import cn.com.wangluotongxin.admin.model.AdminAppVersion;
import cn.com.wangluotongxin.admin.model.constants.AppName;
import cn.com.wangluotongxin.common.web.AjaxResult;
import com.alibaba.dubbo.config.annotation.Reference;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "网络通信-DUBBO服务-应用版本 相关接口")
@RestController
@RequestMapping("/dubbo/app/version")
public class DubboAppVersionController {

    @Reference
    private DAdminAppVersionService appVersionService;

    @ApiOperation("最新版本")
    @GetMapping("/get/top")
    public AjaxResult<AdminAppVersion> getTopVersion() {
        return AjaxResult.success(appVersionService.topVersion(AppName.MALL_APP.getCode()));
    }
}
